<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>12-立体呈现-旋转</title>
    <style>
        .cube {
            position: relative;
            width: 200px;
            height: 200px;
            margin: 100px auto 0;
            /* background: palegreen; */
            /* 过渡动画 */
            transition: all 2s;

            /* 3d呈现 3d视觉效果 */
            transform-style: preserve-3d;
        }
        .cube div {
            position: absolute;
            left: 0;
            top: 0;
            width: 200px;
            height: 200px;
            border-radius: 50%;
        }
        .front {
            background-color: orange;
            transform: translateZ(100px);
      }

        .back {
            background-color: green;
            transform: translateZ(-100px);
        }
      .cube:hover {
        transform: translateX(300px) rotateY(180deg);
      }
       
    </style>
</head>
<body>
    <div class="cube">
        <div class="front">前面</div>
        <div class="back">后面</div>
    </div>
</body>
</html>